<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>StringUtils (Commons Codec 1.8 API)</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="StringUtils (Commons Codec 1.8 API)";
    }
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!--   -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/StringUtils.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/commons/codec/binary/Hex.html" title="class in org.apache.commons.codec.binary"><span class="strong">Prev Class</span></a></li>
<li>Next Class</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/commons/codec/binary/StringUtils.html" target="_top">Frames</a></li>
<li><a href="StringUtils.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.commons.codec.binary</div>
<h2 title="Class StringUtils" class="title">Class StringUtils</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>org.apache.commons.codec.binary.StringUtils</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="strong">StringUtils</span>
extends <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre>
<div class="block">Converts String to and from bytes using the encodings required by the Java specification. These encodings are
 specified in <a href="http://download.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">
 Standard charsets</a>.

 <p>This class is immutable and thread-safe.</p></div>
<dl><dt><span class="strong">Since:</span></dt>
  <dd>1.4</dd>
<dt><span class="strong">Version:</span></dt>
  <dd>$Id: StringUtils.java 1435550 2013-01-19 14:09:52Z tn $</dd>
<dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../org/apache/commons/codec/CharEncoding.html" title="class in org.apache.commons.codec"><code>CharEncoding</code></a>, 
<a href="http://download.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">Standard charsets</a></dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!--   -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../org/apache/commons/codec/binary/StringUtils.html#StringUtils()">StringUtils</a></strong>()</code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!--   -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static byte[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/StringUtils.html#getBytesIso8859_1(java.lang.String)">getBytesIso8859_1</a></strong>(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;string)</code>
<div class="block">Encodes the given string into a sequence of bytes using the ISO-8859-1 charset, storing the result into a new
 byte array.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static byte[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/StringUtils.html#getBytesUnchecked(java.lang.String, java.lang.String)">getBytesUnchecked</a></strong>(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;string,
                 <a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;charsetName)</code>
<div class="block">Encodes the given string into a sequence of bytes using the named charset, storing the result into a new byte
 array.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static byte[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/StringUtils.html#getBytesUsAscii(java.lang.String)">getBytesUsAscii</a></strong>(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;string)</code>
<div class="block">Encodes the given string into a sequence of bytes using the US-ASCII charset, storing the result into a new byte
 array.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static byte[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/StringUtils.html#getBytesUtf16(java.lang.String)">getBytesUtf16</a></strong>(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;string)</code>
<div class="block">Encodes the given string into a sequence of bytes using the UTF-16 charset, storing the result into a new byte
 array.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static byte[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/StringUtils.html#getBytesUtf16Be(java.lang.String)">getBytesUtf16Be</a></strong>(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;string)</code>
<div class="block">Encodes the given string into a sequence of bytes using the UTF-16BE charset, storing the result into a new byte
 array.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static byte[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/StringUtils.html#getBytesUtf16Le(java.lang.String)">getBytesUtf16Le</a></strong>(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;string)</code>
<div class="block">Encodes the given string into a sequence of bytes using the UTF-16LE charset, storing the result into a new byte
 array.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static byte[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/StringUtils.html#getBytesUtf8(java.lang.String)">getBytesUtf8</a></strong>(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;string)</code>
<div class="block">Encodes the given string into a sequence of bytes using the UTF-8 charset, storing the result into a new byte
 array.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/StringUtils.html#newString(byte[], java.lang.String)">newString</a></strong>(byte[]&nbsp;bytes,
         <a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;charsetName)</code>
<div class="block">Constructs a new <code>String</code> by decoding the specified array of bytes using the given charset.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/StringUtils.html#newStringIso8859_1(byte[])">newStringIso8859_1</a></strong>(byte[]&nbsp;bytes)</code>
<div class="block">Constructs a new <code>String</code> by decoding the specified array of bytes using the ISO-8859-1 charset.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/StringUtils.html#newStringUsAscii(byte[])">newStringUsAscii</a></strong>(byte[]&nbsp;bytes)</code>
<div class="block">Constructs a new <code>String</code> by decoding the specified array of bytes using the US-ASCII charset.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/StringUtils.html#newStringUtf16(byte[])">newStringUtf16</a></strong>(byte[]&nbsp;bytes)</code>
<div class="block">Constructs a new <code>String</code> by decoding the specified array of bytes using the UTF-16 charset.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/StringUtils.html#newStringUtf16Be(byte[])">newStringUtf16Be</a></strong>(byte[]&nbsp;bytes)</code>
<div class="block">Constructs a new <code>String</code> by decoding the specified array of bytes using the UTF-16BE charset.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/StringUtils.html#newStringUtf16Le(byte[])">newStringUtf16Le</a></strong>(byte[]&nbsp;bytes)</code>
<div class="block">Constructs a new <code>String</code> by decoding the specified array of bytes using the UTF-16LE charset.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/StringUtils.html#newStringUtf8(byte[])">newStringUtf8</a></strong>(byte[]&nbsp;bytes)</code>
<div class="block">Constructs a new <code>String</code> by decoding the specified array of bytes using the UTF-8 charset.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!--   -->
</a>
<h3>Constructor Detail</h3>
<a name="StringUtils()">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>StringUtils</h4>
<pre>public&nbsp;StringUtils()</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!--   -->
</a>
<h3>Method Detail</h3>
<a name="getBytesIso8859_1(java.lang.String)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getBytesIso8859_1</h4>
<pre>public static&nbsp;byte[]&nbsp;getBytesIso8859_1(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;string)</pre>
<div class="block">Encodes the given string into a sequence of bytes using the ISO-8859-1 charset, storing the result into a new
 byte array.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>string</code> - the String to encode, may be <code>null</code></dd>
<dt><span class="strong">Returns:</span></dt><dd>encoded bytes, or <code>null</code> if the input string was <code>null</code></dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - Thrown if <a href="../../../../../org/apache/commons/codec/Charsets.html#ISO_8859_1"><code>Charsets.ISO_8859_1</code></a> is not initialized, which should never happen since it is
             required by the Java platform specification.</dd><dt><span class="strong">Since:</span></dt>
  <dd>As of 1.7, throws <a href="http://download.oracle.com/javase/6/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang"><code>NullPointerException</code></a> instead of UnsupportedEncodingException</dd>
<dt><span class="strong">See Also:</span></dt><dd><a href="http://download.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">Standard charsets</a>, 
<a href="../../../../../org/apache/commons/codec/binary/StringUtils.html#getBytesUnchecked(java.lang.String, java.lang.String)"><code>getBytesUnchecked(String, String)</code></a></dd></dl>
</li>
</ul>
<a name="getBytesUnchecked(java.lang.String, java.lang.String)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getBytesUnchecked</h4>
<pre>public static&nbsp;byte[]&nbsp;getBytesUnchecked(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;string,
                       <a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;charsetName)</pre>
<div class="block">Encodes the given string into a sequence of bytes using the named charset, storing the result into a new byte
 array.
 <p>
 This method catches <a href="http://download.oracle.com/javase/6/docs/api/java/io/UnsupportedEncodingException.html?is-external=true" title="class or interface in java.io"><code>UnsupportedEncodingException</code></a> and rethrows it as <a href="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang"><code>IllegalStateException</code></a>, which
 should never happen for a required charset name. Use this method when the encoding is required to be in the JRE.
 </p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>string</code> - the String to encode, may be <code>null</code></dd><dd><code>charsetName</code> - The name of a required <a href="http://download.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html?is-external=true" title="class or interface in java.nio.charset"><code>Charset</code></a></dd>
<dt><span class="strong">Returns:</span></dt><dd>encoded bytes, or <code>null</code> if the input string was <code>null</code></dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</a></code> - Thrown when a <a href="http://download.oracle.com/javase/6/docs/api/java/io/UnsupportedEncodingException.html?is-external=true" title="class or interface in java.io"><code>UnsupportedEncodingException</code></a> is caught, which should never happen for a
             required charset name.</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../org/apache/commons/codec/CharEncoding.html" title="class in org.apache.commons.codec"><code>CharEncoding</code></a>, 
<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true#getBytes(java.lang.String)" title="class or interface in java.lang"><code>String.getBytes(String)</code></a></dd></dl>
</li>
</ul>
<a name="getBytesUsAscii(java.lang.String)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getBytesUsAscii</h4>
<pre>public static&nbsp;byte[]&nbsp;getBytesUsAscii(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;string)</pre>
<div class="block">Encodes the given string into a sequence of bytes using the US-ASCII charset, storing the result into a new byte
 array.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>string</code> - the String to encode, may be <code>null</code></dd>
<dt><span class="strong">Returns:</span></dt><dd>encoded bytes, or <code>null</code> if the input string was <code>null</code></dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - Thrown if <a href="../../../../../org/apache/commons/codec/Charsets.html#US_ASCII"><code>Charsets.US_ASCII</code></a> is not initialized, which should never happen since it is
             required by the Java platform specification.</dd><dt><span class="strong">Since:</span></dt>
  <dd>As of 1.7, throws <a href="http://download.oracle.com/javase/6/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang"><code>NullPointerException</code></a> instead of UnsupportedEncodingException</dd>
<dt><span class="strong">See Also:</span></dt><dd><a href="http://download.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">Standard charsets</a>, 
<a href="../../../../../org/apache/commons/codec/binary/StringUtils.html#getBytesUnchecked(java.lang.String, java.lang.String)"><code>getBytesUnchecked(String, String)</code></a></dd></dl>
</li>
</ul>
<a name="getBytesUtf16(java.lang.String)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getBytesUtf16</h4>
<pre>public static&nbsp;byte[]&nbsp;getBytesUtf16(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;string)</pre>
<div class="block">Encodes the given string into a sequence of bytes using the UTF-16 charset, storing the result into a new byte
 array.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>string</code> - the String to encode, may be <code>null</code></dd>
<dt><span class="strong">Returns:</span></dt><dd>encoded bytes, or <code>null</code> if the input string was <code>null</code></dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - Thrown if <a href="../../../../../org/apache/commons/codec/Charsets.html#UTF_16"><code>Charsets.UTF_16</code></a> is not initialized, which should never happen since it is
             required by the Java platform specification.</dd><dt><span class="strong">Since:</span></dt>
  <dd>As of 1.7, throws <a href="http://download.oracle.com/javase/6/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang"><code>NullPointerException</code></a> instead of UnsupportedEncodingException</dd>
<dt><span class="strong">See Also:</span></dt><dd><a href="http://download.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">Standard charsets</a>, 
<a href="../../../../../org/apache/commons/codec/binary/StringUtils.html#getBytesUnchecked(java.lang.String, java.lang.String)"><code>getBytesUnchecked(String, String)</code></a></dd></dl>
</li>
</ul>
<a name="getBytesUtf16Be(java.lang.String)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getBytesUtf16Be</h4>
<pre>public static&nbsp;byte[]&nbsp;getBytesUtf16Be(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;string)</pre>
<div class="block">Encodes the given string into a sequence of bytes using the UTF-16BE charset, storing the result into a new byte
 array.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>string</code> - the String to encode, may be <code>null</code></dd>
<dt><span class="strong">Returns:</span></dt><dd>encoded bytes, or <code>null</code> if the input string was <code>null</code></dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - Thrown if <a href="../../../../../org/apache/commons/codec/Charsets.html#UTF_16BE"><code>Charsets.UTF_16BE</code></a> is not initialized, which should never happen since it is
             required by the Java platform specification.</dd><dt><span class="strong">Since:</span></dt>
  <dd>As of 1.7, throws <a href="http://download.oracle.com/javase/6/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang"><code>NullPointerException</code></a> instead of UnsupportedEncodingException</dd>
<dt><span class="strong">See Also:</span></dt><dd><a href="http://download.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">Standard charsets</a>, 
<a href="../../../../../org/apache/commons/codec/binary/StringUtils.html#getBytesUnchecked(java.lang.String, java.lang.String)"><code>getBytesUnchecked(String, String)</code></a></dd></dl>
</li>
</ul>
<a name="getBytesUtf16Le(java.lang.String)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getBytesUtf16Le</h4>
<pre>public static&nbsp;byte[]&nbsp;getBytesUtf16Le(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;string)</pre>
<div class="block">Encodes the given string into a sequence of bytes using the UTF-16LE charset, storing the result into a new byte
 array.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>string</code> - the String to encode, may be <code>null</code></dd>
<dt><span class="strong">Returns:</span></dt><dd>encoded bytes, or <code>null</code> if the input string was <code>null</code></dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - Thrown if <a href="../../../../../org/apache/commons/codec/Charsets.html#UTF_16LE"><code>Charsets.UTF_16LE</code></a> is not initialized, which should never happen since it is
             required by the Java platform specification.</dd><dt><span class="strong">Since:</span></dt>
  <dd>As of 1.7, throws <a href="http://download.oracle.com/javase/6/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang"><code>NullPointerException</code></a> instead of UnsupportedEncodingException</dd>
<dt><span class="strong">See Also:</span></dt><dd><a href="http://download.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">Standard charsets</a>, 
<a href="../../../../../org/apache/commons/codec/binary/StringUtils.html#getBytesUnchecked(java.lang.String, java.lang.String)"><code>getBytesUnchecked(String, String)</code></a></dd></dl>
</li>
</ul>
<a name="getBytesUtf8(java.lang.String)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getBytesUtf8</h4>
<pre>public static&nbsp;byte[]&nbsp;getBytesUtf8(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;string)</pre>
<div class="block">Encodes the given string into a sequence of bytes using the UTF-8 charset, storing the result into a new byte
 array.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>string</code> - the String to encode, may be <code>null</code></dd>
<dt><span class="strong">Returns:</span></dt><dd>encoded bytes, or <code>null</code> if the input string was <code>null</code></dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - Thrown if <a href="../../../../../org/apache/commons/codec/Charsets.html#UTF_8"><code>Charsets.UTF_8</code></a> is not initialized, which should never happen since it is
             required by the Java platform specification.</dd><dt><span class="strong">Since:</span></dt>
  <dd>As of 1.7, throws <a href="http://download.oracle.com/javase/6/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang"><code>NullPointerException</code></a> instead of UnsupportedEncodingException</dd>
<dt><span class="strong">See Also:</span></dt><dd><a href="http://download.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">Standard charsets</a>, 
<a href="../../../../../org/apache/commons/codec/binary/StringUtils.html#getBytesUnchecked(java.lang.String, java.lang.String)"><code>getBytesUnchecked(String, String)</code></a></dd></dl>
</li>
</ul>
<a name="newString(byte[], java.lang.String)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>newString</h4>
<pre>public static&nbsp;<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;newString(byte[]&nbsp;bytes,
               <a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;charsetName)</pre>
<div class="block">Constructs a new <code>String</code> by decoding the specified array of bytes using the given charset.
 <p>
 This method catches <a href="http://download.oracle.com/javase/6/docs/api/java/io/UnsupportedEncodingException.html?is-external=true" title="class or interface in java.io"><code>UnsupportedEncodingException</code></a> and re-throws it as <a href="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang"><code>IllegalStateException</code></a>, which
 should never happen for a required charset name. Use this method when the encoding is required to be in the JRE.
 </p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>bytes</code> - The bytes to be decoded into characters, may be <code>null</code></dd><dd><code>charsetName</code> - The name of a required <a href="http://download.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html?is-external=true" title="class or interface in java.nio.charset"><code>Charset</code></a></dd>
<dt><span class="strong">Returns:</span></dt><dd>A new <code>String</code> decoded from the specified array of bytes using the given charset,
         or <code>null</code> if the input byte array was <code>null</code>.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</a></code> - Thrown when a <a href="http://download.oracle.com/javase/6/docs/api/java/io/UnsupportedEncodingException.html?is-external=true" title="class or interface in java.io"><code>UnsupportedEncodingException</code></a> is caught, which should never happen for a
             required charset name.</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../org/apache/commons/codec/CharEncoding.html" title="class in org.apache.commons.codec"><code>CharEncoding</code></a>, 
<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true#String(byte[], java.lang.String)" title="class or interface in java.lang"><code>String.String(byte[], String)</code></a></dd></dl>
</li>
</ul>
<a name="newStringIso8859_1(byte[])">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>newStringIso8859_1</h4>
<pre>public static&nbsp;<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;newStringIso8859_1(byte[]&nbsp;bytes)</pre>
<div class="block">Constructs a new <code>String</code> by decoding the specified array of bytes using the ISO-8859-1 charset.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>bytes</code> - The bytes to be decoded into characters, may be <code>null</code></dd>
<dt><span class="strong">Returns:</span></dt><dd>A new <code>String</code> decoded from the specified array of bytes using the ISO-8859-1 charset, or
         <code>null</code> if the input byte array was <code>null</code>.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - Thrown if <a href="../../../../../org/apache/commons/codec/Charsets.html#ISO_8859_1"><code>Charsets.ISO_8859_1</code></a> is not initialized, which should never happen since it is
             required by the Java platform specification.</dd><dt><span class="strong">Since:</span></dt>
  <dd>As of 1.7, throws <a href="http://download.oracle.com/javase/6/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang"><code>NullPointerException</code></a> instead of UnsupportedEncodingException</dd></dl>
</li>
</ul>
<a name="newStringUsAscii(byte[])">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>newStringUsAscii</h4>
<pre>public static&nbsp;<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;newStringUsAscii(byte[]&nbsp;bytes)</pre>
<div class="block">Constructs a new <code>String</code> by decoding the specified array of bytes using the US-ASCII charset.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>bytes</code> - The bytes to be decoded into characters</dd>
<dt><span class="strong">Returns:</span></dt><dd>A new <code>String</code> decoded from the specified array of bytes using the US-ASCII charset,
         or <code>null</code> if the input byte array was <code>null</code>.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - Thrown if <a href="../../../../../org/apache/commons/codec/Charsets.html#US_ASCII"><code>Charsets.US_ASCII</code></a> is not initialized, which should never happen since it is
             required by the Java platform specification.</dd><dt><span class="strong">Since:</span></dt>
  <dd>As of 1.7, throws <a href="http://download.oracle.com/javase/6/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang"><code>NullPointerException</code></a> instead of UnsupportedEncodingException</dd></dl>
</li>
</ul>
<a name="newStringUtf16(byte[])">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>newStringUtf16</h4>
<pre>public static&nbsp;<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;newStringUtf16(byte[]&nbsp;bytes)</pre>
<div class="block">Constructs a new <code>String</code> by decoding the specified array of bytes using the UTF-16 charset.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>bytes</code> - The bytes to be decoded into characters</dd>
<dt><span class="strong">Returns:</span></dt><dd>A new <code>String</code> decoded from the specified array of bytes using the UTF-16 charset
         or <code>null</code> if the input byte array was <code>null</code>.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - Thrown if <a href="../../../../../org/apache/commons/codec/Charsets.html#UTF_16"><code>Charsets.UTF_16</code></a> is not initialized, which should never happen since it is
             required by the Java platform specification.</dd><dt><span class="strong">Since:</span></dt>
  <dd>As of 1.7, throws <a href="http://download.oracle.com/javase/6/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang"><code>NullPointerException</code></a> instead of UnsupportedEncodingException</dd></dl>
</li>
</ul>
<a name="newStringUtf16Be(byte[])">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>newStringUtf16Be</h4>
<pre>public static&nbsp;<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;newStringUtf16Be(byte[]&nbsp;bytes)</pre>
<div class="block">Constructs a new <code>String</code> by decoding the specified array of bytes using the UTF-16BE charset.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>bytes</code> - The bytes to be decoded into characters</dd>
<dt><span class="strong">Returns:</span></dt><dd>A new <code>String</code> decoded from the specified array of bytes using the UTF-16BE charset,
         or <code>null</code> if the input byte array was <code>null</code>.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - Thrown if <a href="../../../../../org/apache/commons/codec/Charsets.html#UTF_16BE"><code>Charsets.UTF_16BE</code></a> is not initialized, which should never happen since it is
             required by the Java platform specification.</dd><dt><span class="strong">Since:</span></dt>
  <dd>As of 1.7, throws <a href="http://download.oracle.com/javase/6/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang"><code>NullPointerException</code></a> instead of UnsupportedEncodingException</dd></dl>
</li>
</ul>
<a name="newStringUtf16Le(byte[])">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>newStringUtf16Le</h4>
<pre>public static&nbsp;<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;newStringUtf16Le(byte[]&nbsp;bytes)</pre>
<div class="block">Constructs a new <code>String</code> by decoding the specified array of bytes using the UTF-16LE charset.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>bytes</code> - The bytes to be decoded into characters</dd>
<dt><span class="strong">Returns:</span></dt><dd>A new <code>String</code> decoded from the specified array of bytes using the UTF-16LE charset,
         or <code>null</code> if the input byte array was <code>null</code>.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - Thrown if <a href="../../../../../org/apache/commons/codec/Charsets.html#UTF_16LE"><code>Charsets.UTF_16LE</code></a> is not initialized, which should never happen since it is
             required by the Java platform specification.</dd><dt><span class="strong">Since:</span></dt>
  <dd>As of 1.7, throws <a href="http://download.oracle.com/javase/6/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang"><code>NullPointerException</code></a> instead of UnsupportedEncodingException</dd></dl>
</li>
</ul>
<a name="newStringUtf8(byte[])">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>newStringUtf8</h4>
<pre>public static&nbsp;<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;newStringUtf8(byte[]&nbsp;bytes)</pre>
<div class="block">Constructs a new <code>String</code> by decoding the specified array of bytes using the UTF-8 charset.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>bytes</code> - The bytes to be decoded into characters</dd>
<dt><span class="strong">Returns:</span></dt><dd>A new <code>String</code> decoded from the specified array of bytes using the UTF-8 charset,
         or <code>null</code> if the input byte array was <code>null</code>.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - Thrown if <a href="../../../../../org/apache/commons/codec/Charsets.html#UTF_8"><code>Charsets.UTF_8</code></a> is not initialized, which should never happen since it is
             required by the Java platform specification.</dd><dt><span class="strong">Since:</span></dt>
  <dd>As of 1.7, throws <a href="http://download.oracle.com/javase/6/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang"><code>NullPointerException</code></a> instead of UnsupportedEncodingException</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!--   -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/StringUtils.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/commons/codec/binary/Hex.html" title="class in org.apache.commons.codec.binary"><span class="strong">Prev Class</span></a></li>
<li>Next Class</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/commons/codec/binary/StringUtils.html" target="_top">Frames</a></li>
<li><a href="StringUtils.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2002-2013 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.</small></p>
</body>
</html>
